#include "Heap.h"

void test()
{
	Heap hp;
	HeapCreate(&hp);
	printf("%d\n", HeapSize(&hp));
	HeapPush(&hp, 9);
	HeapPush(&hp, 3);
	HeapPush(&hp, 8);
	HeapPush(&hp, 1);
	HeapPush(&hp, 4);
	HeapPush(&hp, 2);
	HeapPush(&hp, 2);
	HeapPush(&hp, 7);
	printf("%d\n", HeapSize(&hp));
	printf("%d\n", HeapTop(&hp));
	printf("%d\n", HeapSize(&hp));
	HeapPop(&hp);
	HeapPop(&hp);
	for (int i = 0; i < hp.size; i++)
	{
		printf("%d ", hp.a[i]);
	}
	HeapDestory(&hp);
}


void test1()
{
	//CreateNDate();
	PrintTopK(10);
}

void test2()
{
	int a[] = { 6,3,5,4,4,1,2,8,9,0 };
	HeapSort(a, sizeof(a) / sizeof(a[0]));
	for (int i = 0; i < sizeof(a) / sizeof(a[0]); i++)
	{
		printf("%d ", a[i]);
	}
}

int main()
{
	//test();
	//test1();
	test2();
	return 0;
}